const mongoose = require('../db');
const Schema = mongoose.Schema;
// const ObjectId = Schema.ObjectId;
const userSchema = new Schema({
    _id: String,
    username: String,
    password: String,
    sex: String,
    email: String,
    age: Number,
    phone: String,
    wechat: String,
    qq: Number,
    createtime: {type: Date, default: Date.now}
})


// userSchema.statics.login = (params, callback) => {
//     console.log(params)
//     return this.model('user').find({name: params.name}, callback);
// }

var User = mongoose.model('user', userSchema, 'users');

// User.find({}).then((res) => {
//     console.log(res)
// })
module.exports = User


